Skip to content

Conversation

@epoberezkin
Copy link
Member

@epoberezkin epoberezkin commented Sep 16, 2025

see comments in #1613

@epoberezkin
Copy link
Member Author

@p1gp1g please see the last commit and lets talk

epoberezkin and others added 10 commits November 10, 2025 20:23
* Parse WPDeviceToken during registration

* Clarify PPInvalidPusher with apnsPushProviderClient

* Use SrvLoc for webpush endpoints

* Remove unused WPEndpoint

* Test RFC8291 - webpush encryption - implementation

* Fix tests with -fserver_postgres

* Disable redirections with webpush

* Rename webpush tests, and move behind server_postgres flag

* Parse webpush endpoint with StrEncoding

* Fix rename webpush tests

* Lint import

* Test push notification encoding for webpush

* Test strDecoding invalid WPDeviceToken
@epoberezkin epoberezkin force-pushed the p1gp1g-webpush_requests branch from e21323a to 98280e2 Compare November 12, 2025 10:21
@epoberezkin epoberezkin force-pushed the p1gp1g-webpush_requests branch from 98280e2 to e3f8937 Compare November 12, 2025 10:23
_ -> PPWPOtherError $ tshow e
where
fromStatusCode status reason
| status == N.status200 = PPWPRemovedEndpoint
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with 404?


-- | encrypt :: UA key -> AS key -> salt -> clear -> cipher
-- | https://www.rfc-editor.org/rfc/rfc8291#section-3.4
wpEncrypt' :: WPKey -> ECC.PrivateNumber -> ByteString -> ByteString -> ExceptT C.CryptoError IO ByteString
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add symmetric decrypt function and test

ivFrom :: ByteString -> ExceptT C.CryptoError IO C.GCMIV
ivFrom s = liftEither $ C.gcmIV s

encodeWPN :: PushNotification -> BL.ByteString
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add symmetric decodeWPN

shift i w = Bits.shiftL (fromIntegral w) (64 * i)

data WPTokenParams = WPTokenParams
{ wpPath :: ByteString,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with relative URI as discussed

PPAPNS p -> APNSDeviceToken p . encodeUtf8 <$> (o .: "token")

-- | Returns fields for the device token (pushProvider, token)
-- TODO [webpush] save token as separate fields
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different fields for different token subtypes, same for deviceTokenFields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants